<?php /* SVN: $Id: index.ctp 2618 2010-08-09 02:17:43Z jayashree_028ac09 $ */ ?>
<div class="projectComments view-comments index js-response">
<div class="l-curve-top">							
		<div class="r-curve-top">
				<div class="top-bg"></div>
		</div>
						</div>
						<div class="shad-bg-lft clearfix">
							<div class="shad-bg-rgt">
								<div class="shad-bg">
								<div class="main-section">
    <?php  $this->element('paging_counter');?>
            <div class="comments-block">
            <div class="comments-top">
                    <div class="comment clearfix"><span title="Thrity Six"><?PHP echo $project['Project']['project_comment_count']?> </span>comments</div>
            </div>
                </div>

    <ol class="list clearfix comments comments-list js-comment-responses" start="<?php echo $this->Paginator->counter(array(
        'format' => '%start%'
    ));?>">
    <?php
if (!empty($projectComments)):
        $i = 0;
        foreach ($projectComments as $projectComment):
        	$class = null;
        	if ($i++ % 2 == 0) :
        		$class = 'altrow';
            endif;
            ?>
            <li class="list-row  clearfix <?php echo $class;?>" id="comment-<?php echo $projectComment['ProjectComment']['id']?>">
                   <div class="clearfix">
                        <div class="avatar1 grid_1 alpha omega"><?php echo $this->Html->getUserAvatar($projectComment['User']['id'],'comment_avatar_thumb');?></div>
                        <div class="user-comments  grid_12 clearfix alpha omega">
                          <div class="clearfix">
                            <h4 class="user-name grid_left">
                            <?php echo $this->Html->link('#', '#comment-' . $projectComment['ProjectComment']['id'], array('class' => 'js-scrollto'));?>
                            <?php echo $this->Html->link($this->Html->cText($projectComment['User']['username']), array('controller' => 'users', 'action' => 'view', $projectComment['User']['username']), array('title' => $projectComment['User']['username'], 'escape' => false));?>
                            <span class="meta date-block-info posted-date"><?php echo sprintf(__l('-Posted on %s'), $this->Html->cDateTimeHighlight($projectComment['ProjectComment']['created'])); ?></span>
                            </h4>
                                        <?php if ($projectComment['ProjectComment']['user_id'] == $this->Auth->user('id') || $this->Auth->user('user_type_id') == ConstUserTypes::Admin ) : ?>
                            <div class="actions grid_right">
                                <?php echo $this->Html->link(__l('Delete'), array('controller' => 'project_comments', 'action' => 'delete', $projectComment['ProjectComment']['id']), array('class' => 'delete js-ajax-delete', 'title' => __l('Delete')));?>
                            </div>
                        <?php endif; ?>
                          </div>
                          <p><?php echo $this->Html->cText($projectComment['ProjectComment']['comment']);?></p>
                        </div>
            
                  </div>
       	
            </li>
            <?php
        endforeach;
    else:
        ?>
    	<li>
    		<p class="notice"><?php echo __l('No comments available');?></p>
    	</li>
        <?php
    endif;
    ?>
    </ol>

        <?php
        if (!empty($projectComments)) : ?>
    <div class="js-pagination paging">
           <? echo $this->element('paging_links'); ?>
    </div>
        <?php endif;
        ?>


<?php
	if($this->Auth->sessionValid()):
		 echo $this->element('../project_comments/add', array('config' => 'sec'));
	 else:?>
	   <p class="notice"><?php echo sprintf(__l('Please %s to post comment'), $this->Html->link(__l('login'), array('controller' => 'users', 'action' => 'login', '?' => 'f=project/' . $project['Project']['slug']), array('title' => 'login'))) ;?></p>
	<?php  endif;
 ?>
</div>
</div>
</div>
		</div>
					<div class="l-curve-bot">
							<div class="r-curve-bot">
								<div class="bot-bg"></div>
							</div>
						</div>
	</div>
			
